﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tools.Domain.Specifications;
using Webshop20.Domain.Catalog.Core.Products.Filter.InputContracts;
using Webshop20.Domain.Catalog.Specifications;
using Webshop20.Domain.Shared.Products.Core;

namespace Webshop20.Domain.Catalog.Core.Products.Filter.Implementations
{
    public class ProductsByCategorySpecificationFilter : ISpecificationFilter<Product>
    {
        #region ISpecificationFilter<Product> Members

        public void  AddSpecificationTo<S>(ref IList<ISpecification<Product>> specifications, S data)  
        {
            var category = data as ICategory;
            specifications.Add(new CategorySpecification(category.CategoryId));
        }

        #endregion


    }
}